import request from "/@/utils/request"

export function fetchList(query?: Object) {
  return request({
    url: '/excesysiot/sceneLinkage/page',
    method: 'get',
    params: query
  })
}

export function addObj(obj?: Object) {
  return request({
    url: '/admin/sceneLinkage',
    method: 'post',
    data: obj
  })
}

export function getObj(id?: string) {
  return request({
    url: '/excesysiot/sceneLinkage/' + id,
    method: 'get'
  })
}

export function delRuleObj(ids?: Object) {
  return request({
    url: '/admin/sceneLinkage',
    method: 'delete',
    data: ids
  })
}

export function putObj(obj?: Object) {
  return request({
    url: '/admin/sceneLinkage',
    method: 'post',
    data: obj
  })
}
export function refreshCache() {
	return request({
		// url: '/admin/client/sync',
		// method: 'put',
	});
}
// 设备类型
export function equipmentTypeList(id?: string) {
  return request({
    url: '/admin/accessCategory/list',
    method: 'get'
  })
}
// 设备产品
export function accessProductList(query?: Object) {
  return request({
    url: '/admin/accessProduct/list',
    method: 'get',
    params: query
  })
}
// 设备信息
export function accessDeviceInfoList(query?: Object) {
  return request({
    url: '/admin/accessDeviceInfo/list',
    method: 'get',
    params: query
  })
}
//  设备信息---
export function accessDevicePage(query?: Object) {
  return request({
    url: '/admin/accessDevice/page',
    method: 'get',
    params: query
  })
}
// 设备信号类型
export function accessThingModelList(query?: Object) {
  return request({
    // url: '/admin/accessThingModel/list',
    // url: '/admin/accessThingModel/getlistProperties',
    url: '/admin/accessThingModel/getThingModelByProductKey',
    method: 'get',
    params: query
  })
}
// 设备下发
export function getlistServicesList(query?: Object) {
  return request({
    url: '/admin/accessThingModel/getlistServices',
    method: 'get',
    params: query
  })
}
// 更改状态
export function updateStatus(query?: Object) {
  return request({
    url: '/admin/sceneLinkage/updateStatus',
    method: 'get',
    params: query
  })
}
export function getDetails(id?: string) {
  return request({
    url: '/admin/sceneLinkage/' + id,
    method: 'get'
  })
}
// 日志
export function getLog(query?: Object) {
  return request({
    // url: '/admin/sceneLinkage/getLog',
    url: '/admin/sceneLinkageLog/page',
    method: 'get',
    params: query
  })
}
export function getDetailUnit(query?: Object) {
  return request({
    url: '/admin/accessDevice/detail',
    method: 'get',
    params: query
  })
}
// 触发
export function getTrigger(id?: string) {
  return request({
    url: '/admin/sceneLinkage/operate/' + id,
    method: 'get'
  })
}

